﻿#ifndef PST_PSTSPLITTERHANDLE_H
#define PST_PSTSPLITTERHANDLE_H

#include <QObject>
#include <QSplitterHandle>
#include <QMouseEvent>
namespace pst
{
    class PstSplitterHandle : public QSplitterHandle
    {

    public:
        PstSplitterHandle(Qt::Orientation orientation, QSplitter* parent)
            : QSplitterHandle(orientation, parent) {}

    protected:
        void mouseMoveEvent(QMouseEvent* event) override
        {
            // 阻止默认的鼠标拖动行为
            event->ignore(); // 或直接调用父类但不执行拖动逻辑
        }

        void enterEvent(QEvent* event) override
        {
            // 设置光标为默认箭头
            setCursor(Qt::ArrowCursor);
            QSplitterHandle::enterEvent(event);
        }

        void leaveEvent(QEvent* event) override
        {
            // 恢复默认光标
            unsetCursor();
            QSplitterHandle::leaveEvent(event);
        }
    };

#endif // !PST_PSTSPLITTERHANDLE_H
}

